package rozetka.pageObjects;

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;

public class BasketPage {
	WebDriver driver;
	private static final By titleCreationOfOrder = By
			.xpath("/html/body/div/div/section/h1");

	public BasketPage(WebDriver driver) {
		this.driver = driver;
	}

	public void inputZeroOrder() {
		driver.findElement(By.className("input-text")).clear();
		driver.findElement(By.className("input-text")).sendKeys("0");
	}

	public void submitOrder() {
		driver.findElement(By.id("drop-block")).submit();
		driver.manage().timeouts().implicitlyWait(6, TimeUnit.SECONDS);
	}

	public boolean isZeroRegistrationPassed() {
		return driver.findElement(titleCreationOfOrder).isDisplayed();
	}

}
